package Day001_继承_抽象类.demo05this_super.demo01_This三种用法;

public class Student {
     String name = "张三";

     public void show(){
         String name = "李四";
         System.out.println("局部变量:" + name); //李四
         System.out.println("成员变量:" + this.name); //张三
     }

     public void eat(){
         System.out.println("吃饭...");
         this.sleep();
     }

     public void sleep(){
         System.out.println("睡觉...");
     }

     public Student(){
         System.out.println("空参构造");
     }

    public Student(String name){
        this(); //本方法的空参构造方法
        this.name = name;
        System.out.println("有参构造");
    }
}
